package com.zh.business.vo.mp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zh.zhbootcommon.entity.taxi.DTaxiAddressInfo;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 描述: 打车订单返回
 *
 * @author: yanglin
 * @Date: 2021-08-19-10:01
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TaxiOrderRep implements Serializable {

    /**
     * 打车订单ID
     */
    private Integer orderId;

    /**
     * 打车订单号
     */
    private String orderCode;

    /**
     * 打车订单状态
     * 订单状态(10-已创建(乘客发单) 20-已确认(司机接单) 30-已支付(乘客付款) 40-已完成 50-已取消)
     */
    private Integer orderStatus;

    /**
     * 打车车型
     */
    private String wayType = "专车";

    /**
     * 乘客数量
     */
    private Integer orderTaxiNum;

    /**
     * 订单费用(以分为单位)
     */
    private Integer orderPrice;

    /**
     * 订单过期时间
     */
    private long orderEndTime;

    /**
     * 订单创建时间
     */
    @DateTimeFormat(pattern="yyyy年MM月dd日 HH:mm")
    @JsonFormat(
            pattern = "yyyy年MM月dd日 HH:mm",
            timezone = "GMT+8"
    )
    public LocalDateTime createTime;

    /**
     * 小程序用户-乘客openId
     */
    private String mOpenId;

    /**
     * 小程序用户-司机openId
     */
    private String dOpenId;

    /**
     * 出发地址详细
     */
    private String taxiFirstDetail;

    /**
     * 目标地址详细
     */
    private String taxiLastDetail;

    /**
     * 地址
     */
    private DTaxiAddressInfo addressInfo;

    public TaxiOrderRep(){}

    @Builder
    public TaxiOrderRep(Integer orderId, String orderCode, Integer orderStatus, Integer orderTaxiNum, Integer orderPrice, long orderEndTime, LocalDateTime createTime, String mOpenId, String dOpenId, DTaxiAddressInfo addressInfo) {
        this.orderId = orderId;
        this.orderCode = orderCode;
        this.orderStatus = orderStatus;
        this.orderTaxiNum = orderTaxiNum;
        this.orderPrice = orderPrice;
        this.orderEndTime = orderEndTime;
        this.createTime = createTime;
        this.mOpenId = mOpenId;
        this.dOpenId = dOpenId;
        this.addressInfo = addressInfo;
    }
}
